﻿using UnityEngine;
using System.Collections;

public class TraitSelExit : MonoBehaviour {

	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
	
	}

    void OnClick()
    {
        transform.parent.GetComponent<TweenPosition>().Play(false);
        EventDelegate.Add(transform.parent.GetComponent<TweenPosition>().onFinished, DestroyThis);
    }

    void DestroyThis()
    {
        Destroy(transform.parent.gameObject);
    }
}
